<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/videos.css" />
<title>Video Hàn Quốc</title>
<link rel="stylesheet" type="text/css" href="engine1/style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta name="keywords" content="WOW Slider, Wordpress Gallery Slider, Wordpress Photo Slider" />
<meta name="description" content="WOWSlider created with WOW Slider, a free wizard program that helps you easily generate beautiful web slideshow" />
<script language="javascript" type="text/javascript" src="engine1/jquery.js"></script>

</head>
<?php include_once('master_menu.php');?>
<div class="page">
  <div class="videopage">
    <div class="menuvideo">
      <ul class="menu2">
      <li> <a href="video.php">Nổi Bật</a> </li>
        
        <li> <a href="video_vietnam.php">Việt Nam</a> </li>
        <li> <a href="video_aumy.php">Ậu Mỹ</a> </li>
        <li class="select"> <span>Hàn Quốc</span> </li>
        
        <li> <a href="video_hoangu.php">Hoa Ngữ</a> </li>
        <li> <a href="video_japan.php">Nhật Bản</a> </li>
        <li> <a href="video_hoatau.php">Hòa Tấu</a> </li>
      </ul>
    </div>
    <div class="content-block">
      <h2 class="h2album"> <a href="#">Video Hàn Quốc</a></h2> 
          <?php
                $conn = mysql_connect("localhost", "root","123456") or die("Ket noi den MySQL that bai");
                mysql_select_db("mp3", $conn);
                mysql_query("SET NAMES UTF8",$conn);
					  if (!isset($_GET['page'])) 
						  {
							  $_GET['page'] = 1;
						  }
					 $vitri = ($_GET["page"] - 1 ) * 3 ;    
                $sql = "select * from music_nghesi 
                        inner join music on music_nghesi.id_music=music.id_music 
                        inner join nghesi on music_nghesi.id_nghesi=nghesi.id_nghesi 
								where `nghesi`.`quoctich` = 'Korea' and `music`.`loai` = 1 limit ".$vitri.",3";
    $q = mysql_query($sql);             
              while ($row = mysql_fetch_array($q))               
                {
                    $nghesi=$row["nghedanh"];
                    $picnghesi=$row["pic"];
                    $id=$row["id_nghesi"];
                    $baihat=$row["id_music"];
                    $tenbh=$row["tenmusic"];
            
      ?>
      <div class="content-video2"> <a href="chitietvideo.php?id=<?=$baihat?>&idcs=<?=$id?>"><img src="<?=$picnghesi?>"></a> <span class="meta"> 
        <a id="a1" href="chitietvideo.php?id=<?=$baihat?>&idcs=<?=$id?>" ><?=$tenbh?></a><br>
        <a id="a2" href="artist_page.php?id=<?=$id?>"><?=$nghesi?></a> </span> </div>
         <?php
       }
       
		 $re = mysql_query("select * from `music_nghesi` 
                inner join `nghesi` on `nghesi`.`id_nghesi`=`music_nghesi`.`id_nghesi` 
                inner join `music` on `music`.`id_music` = `music_nghesi`.`id_music`
                where `nghesi`.`quoctich` = 'Korea' and `music`.`loai` = 1");
    $n = mysql_num_rows($re);
    
    $tong_so_trang = floor($n/3);
    echo"<ul style='  margin:0;text-align:center'>";
    if ($_GET['page'] > 1) 
    { 
        echo"<li class='ptrang2'>";
        echo '<a href=video_korea.php?page='.($_GET['page']-1).'>&emsp;back&emsp;</a>';
        echo"</li>";
    }
    $begin=$_GET['page']-3;
    if ($begin < 1)
    {
        $begin=1;
    }
    $end=$_GET['page']+3;
    if ($end > $tong_so_trang)
    {
        $end = $tong_so_trang;
    }
   
     for ($i=$begin ; $i<=$end ; $i++) 
     {
     
       if ($i == $_GET["page"]) 
       {
       echo"<li class='ptrang'>";
       echo $i;
       echo"</li>";
       }
       else
     {
            echo"<li class='ptrang2'>";
            echo '<a style="border:1px solid black;" href=video_korea.php?page='.$i.'>&emsp;'.$i.'&emsp;</a>';
            echo"</li>";
     }
      }
      
      if ($_GET['page'] < $tong_so_trang) 
    { 
        echo"<li class='ptrang2'>";
        echo '<a style="border:1px solid black;" href=video_korea.php?page='.($_GET['page']+1).'>&emsp;next&emsp;</a>';
        echo"</li>";
    }  
      echo"</ul>";
       mysql_close($conn);
       ?>  
        
    </div>
  </div>
  <?php include_once('master_quangcao.php');?>
</div>
<?php include_once('master_footer.php');?>